package com.dpad.telematicsclientapp.weight;

import android.app.Activity;
import android.app.Dialog;


import com.dpad.telematicsclientapp.android.R;

public class DialogPPWUtils {


    /**
     * 自定义 确定/取消 dialog   左边是确定，右边是取消的
     *
     * @param activity
     * @param title     弹窗的标题
     * @param message   提示文字内容
     * @param imgview   显示的图片
     * @param cancleText      取消文字
     * @param confirmText     确定文字
     * @param onCloseListener
     * @return
     */
    public static Dialog showBasicDialog(Activity activity, String title, int imgview,String message, String cancleText,
                                         String confirmText, BasicPPWDialog.OnCloseListener onCloseListener) {
        BasicPPWDialog basicDialog = new BasicPPWDialog(activity, R.style.basic_dialog, onCloseListener);
        basicDialog.setTitle(title)
                .setImgView(imgview)
                .setContent(message)
                .setPositiveButton(confirmText)
                .setNegativeButton(cancleText)
                .show();
        return basicDialog;
    }



    /**
     * 自定义 确定/取消 dialog   左边是确定，右边是取消的  没有图片的  黑色框
     *
     * @param activity
     * @param title     弹窗的标题
     * @param message   提示文字内容
     * @param cancleText      取消文字
     * @param confirmText     确定文字
     * @param onCloseListener
     * @return
     */
    public static Dialog showBasicDialogs(Activity activity, String title,String message, String cancleText,
                                         String confirmText, BasicPPWDialogs.OnCloseListener onCloseListener) {
        BasicPPWDialogs basicDialog = new BasicPPWDialogs(activity, R.style.basic_dialog, onCloseListener);
        basicDialog.setTitle(title)
                .setContent(message)
                .setPositiveButton(confirmText)
                .setNegativeButton(cancleText)
                .show();
        return basicDialog;
    }

//下面只有一个确定按钮的弹窗
    public static Dialog showOneButtonDialogs(Activity activity, String title,String message,
                                          String confirmText, BasicOneButtonDialogs.OnCloseListener onCloseListener) {
        BasicOneButtonDialogs basicDialog = new BasicOneButtonDialogs(activity, R.style.basic_dialog, onCloseListener);
        basicDialog.setTitle(title)
                .setContent(message)
                .setPositiveButton(confirmText)
                .show();
        return basicDialog;
    }


}
